<?php

interface LightJob_ILightJob
{
	/**
	 * List the pending jobs
	 *
	 * @return array the pending jobs
	 */
	public function listPendingJobs();

	/**
	 * Tells whether there are pending jobs are not
	 *
	 * @return boolean true if there are pending jobs, false otherwise
	 */
	public function hasPendingJobs();
	
	/**
	 * Marks the specified jobs as completed
	 *
	 * @param array $jobs
	 */
	public function markJobsCompleted($jobs);

	/**
	 * Marks the specified job as completed
	 *
	 * @param array $job
	 */
	public function markJobCompleted($job);
	
	/**
	 * Deleted all executed jobs
	 *
	 */
	public function cleanJobs();
	
	/**
	 * Processes one iteration
	 *
	 */
	public function process();
	
	/**
	 * Returns the number of jobs
	 *
	 * @return integer
	 */
	public function countJobs();
	
	/**
	 * Launches the daemon
	 *
	 */
	public function run();
	
	/**
	 * Processes the specified jobs
	 *
	 * @param array $jobs
	 */
	public function processJobs($jobs);
	
	/**
	 * Process the specified job
	 *
	 * @param array $job
	 */
	public function processJob($job);
	
}